﻿<!-- #modal-alert -->
<div class="modal fade" id="password-box">
    <div class="modal-dialog">
        <form id="js_profileForm" action="{U('profile/save')}" method="post">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">修改个人资料</h4>
            </div>

            <div class="modal-body">

                    {$admin_id = admin_helper::get_admin_id()}
                    {$admin_info = _uri('admin', $admin_id)}
                    <fieldset>
                        <div class="form-group">
                            <label>登录账号</label>
                            <input type="text" name="admin_name" class="form-control" placeholder="请输入5-20位字母或下划线" value="{$admin_info.admin_name}" datatype="*5-20" nullmsg="请填写登录账号！">
                            <span class="Validform_checktip"></span>
                        </div>

                        <div class="form-group">
                            <label>用户昵称</label>
                            <input type="text" name="nick_name" class="form-control"  placeholder="请输入用户昵称" value="{$admin_info.nick_name}" datatype="*2-20" nullmsg="请填写用户昵称！" errormsg="请输入2-20个字符">
                            <span class="Validform_checktip"></span>
                        </div>

                        <div class="form-group">
                            <label>登录密码</label>
                            <input type="password" name="password" class="form-control"  placeholder="输入要修改的密码，不修改留空" ignore="ignore" datatype="*6-20"  errormsg="密码只能由6-20个字符或下划线组成">
                            <span class="Validform_checktip"></span>
                        </div>

                        <div class="form-group">
                            <label>确认密码</label>
                            <input type="password" name="password" class="form-control"  placeholder="再次输入要修改的密码，不修改留空" ignore="ignore" datatype="*" recheck="password"  errormsg="重复密码与密码不一致">
                            <span class="Validform_checktip"></span>
                        </div>

                    </fieldset>

            </div>
            <div class="modal-footer">
                <a href="javascript:;" class="btn btn-sm btn-white" data-dismiss="modal">关闭</a>
                <a href="javascript:;" class="btn btn-sm btn-success" id="js_profileSubmit">提交</a>
            </div>
        </div>
        </form>
    </div>
</div>
<!-- begin scroll to top btn -->
<a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
<!-- end scroll to top btn -->
</div>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="{STATIC_PLUG}/pace/pace.min.js"></script>
<!--[if lt IE 9]>
<script src="{STATIC_PLUG}/crossbrowserjs/html5shiv.js?v={VERSION}"></script>
<script src="{STATIC_PLUG}/crossbrowserjs/respond.min.js?v={VERSION}"></script>
<script src="{STATIC_PLUG}/crossbrowserjs/excanvas.min.js?v={VERSION}"></script>
<![endif]-->

<!--滚动条插件-->
<script src="{STATIC_PLUG}/slimscroll/jquery.slimscroll.min.js?v={VERSION}"></script>
<script src="{STATIC_PLUG}/jquery-cookie/jquery.cookie.js?v={VERSION}"></script>
<script src="{STATIC_JS}/apps.js?v={VERSION}"></script>
<!-- ================== END BASE JS ================== -->

<!--BEGIN 表单验证插件-->
<script src="{STATIC_PLUG}/validform/v5.3.2_min.js"></script>
<script src="{STATIC_PLUG}/validform/datatype.js"></script>
<link href="{STATIC_PLUG}/validform/css.css?v={VERSION}" rel="stylesheet" />
<!--END 表单验证插件-->

<script>
    $(document).ready(function() {
        //表单验证
        $("#js_profileForm").Validform({

            tiptype:function(msg,o,cssctl){

                if(!o.obj.is("form")){
                    var objtip=o.obj.siblings(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }

            },

            label:"label",

            ajaxPost:true,

            btnSubmit:"#js_profileSubmit",

            beforeSubmit:function(){

                $("#js_profileSubmit").attr("disabled", "disabled").text('提交中..');

            },

            callback:function(json){

                if(json.code == 200){
                    if(confirm(json.msg)){
                        location.reload();
                    }else{
                        return ;
                    }
                }else{
                    alert(json.msg);
                    $("#js_profileSubmit").text('重新登录').removeAttr("disabled");
                    return;

                }

            }

        });
        App.init();
    });
</script>
</body>
</html>